<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<c-rt:set var="tp" value="${pu:pageableTag('tpp', 2, 10)}"/>
${pu:criteriaForName('com.yaodian100.crm.workorder.entity.Holiday') }
${pu:criteriaAddOrder(pu:criteriaOrderAsc('day')) }
<c-rt:set var="results" value="${pu:criteriaResult(tp)}"/>

<br />
<h1>工单假日管理

</h1>

<table>
<tr>
<td>
<input onclick="doAR('<%=application.getContextPath() %>/workOrder/holiday/page.do?iamlazy=updateHoliday', 'dialog');openDialog()" type="button"  value="新增"/>
<input onclick="doAR('<%=application.getContextPath() %>/workOrder/holiday/page.do?iamlazy=updateHolidayClass', 'dialog');openDialog()" type="button"  value="新增行事历分类"/></td>
</tr>
</table>

<table class="tb-1" width="100%">
		<thead>
			<tr>
				<th></th>
				<th>行事历类别</th>
				<th>假日日期</th>
				<th>假日名称</th>
				<th>修改人员</th>
				<th>修改日期</th>
				
			</tr>
		</thead>
		<tbody>
			<c-rt:forEach items="${results}" var="result" varStatus="rows_index">
			<c-rt:set var="option" value="${pu:get('com.yaodian100.crm.workorder.entity.Holiday',pu:toLong(result.menuOptionId))}"/>
				<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">
					<td>
					<input type="button" value="编辑" onclick="doAR('<%=application.getContextPath() %>/workOrder/holiday/page.do?iamlazy=updateHoliday&AJAX=true&refreshZone=main&id=${result.id}', 'dialog');openDialog()"/>
					<input type="button" value="删除" onclick="if(confirm('确定删除？')){deleteHoliday('${result.id}')}"/>
					</td>
					<td>${pu:get('com.yaodian100.core.menu.entity.Option', result.menuOptionId).name }</td>
					<td><fmt-rt:formatDate value="${result.day}" pattern="yyyy/MM/dd"/></td>
					<td>${result.name}</td>
					<td>${result.modifyUser }</td>
					<td>${result.modifyDate}</td>

				</tr>
			</c-rt:forEach>
		</tbody>
	</table>
<c-rt:set var="url">
<%=application.getContextPath() %>/workOrder/holiday/page.do
</c-rt:set>
<pageable:Pageable url="${url}" escapeparams="iamlazy,AJAX,refreshZone" parameter="iamlazy=list&AJAX=true&refreshZone=main" formname="woForm" key="tpp"></pageable:Pageable>
<script>
function deleteHoliday(id){
	doAR('<%=application.getContextPath()%>/workOrder/holiday/deleteHoliday.do?id='+id, 'main');
}
$(document).ready(function(){
	
	
});
</script>